#!/bin/bash

log-debug "bootstrapping bundle from server b to server a..."
docker compose exec -T spire-server-b \
    /opt/spire/bin/spire-server bundle show -format spiffe \
| docker compose exec -T spire-server-a \
    /opt/spire/bin/spire-server bundle set -format spiffe -id spiffe://domain-b.test

log-debug "bootstrapping bundle from server a to server b..."
docker compose exec -T spire-server-a \
    /opt/spire/bin/spire-server bundle show -format spiffe \
| docker compose exec -T spire-server-b \
    /opt/spire/bin/spire-server bundle set -format spiffe -id spiffe://domain-a.test
